<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./vue.js"></script>
</head>
<body>
  <div id="app">
    <hello-world></hello-world>
    <hello2></hello2>
  </div>
  <div id="app1">
    <hello-world></hello-world>
    <!-- hello2是app实例里局部注册的组件，所以这里用不了 -->
    <!-- <hello2></hello2> -->
  </div>
  <script>
    // 定义了对象
    const hello = {
      template: '<p>hello components</p>'
    }

    // 把这个hello对象注册成为一个helloWorld全局组件
    Vue.component('helloWorld', hello)

    const hello2 = {
      template: '<p>hello components2222</p>'
    }

    const app = new Vue({
      el: '#app',
      data: {
        title: 'hello 1912'
      },
      components: {
        hello2
      }
    })

    const app1 = new Vue({
      el: '#app1',
      data: {
      }
    })
  </script>
</body>
</html>
